package com.unytech.project.entity.system;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Index;

import com.unytech.project.entity.BaseEntity;

/**
 * 单元类
 * @author 王文龙
 * 单元代表一种抽象群体，例如单位、部门等
 */
@Entity
@Table( name="T_ERRORRECORD" )
@GenericGenerator(name="uuidpk",strategy="uuid")
public class Unit extends BaseEntity {
	@Id @GeneratedValue(generator="uuidpk")
	@Column(length=32,nullable=false)
	@Index(name="unit_index")
	private String unitid;
	
	private String unitname;
	
	/** 父单元 */
	@Transient
	private Unit parunit;
	
	/** 子单元 */
	@Transient
	private Set<Unit> subunit;
	
	
}
